
%Paste Table
od = [
    .11	.1	.18	.12	.11
.12	.14	.24	.15	.13
.29	.27	.43	.25	.22
.54	.73	.85	.50	.46
];

t = [
    0
90
240
390
];

tvec = repmat(t,1,size(od,2));
tt = min(t):max(t);

for i = 1:size(od,2)
    %Model by matrix division: y=be^(at) == log(y)=at+log(b)
    coeff(:,i)=[t ones(numel(t),1)]\log(od(:,i));
    [corr,pcorr] = corrcoef(t,log(od(:,i)));
    r2(i) = corr(1,2)^2;
    pval(i)  = pcorr(1,2);
    y(:,i) = exp(coeff(1,i)*tt+coeff(2,i));
end

%input string, copied from table headers
lstr = 'yTS7	yTS17	yTS24	yTS27	yHy1';
leg = regexp(lstr,'\s+','split');

for i = 1:numel(leg)
    leg{i} = [leg{i} ', ' num2str(coeff(1,i),2)];
end

plot(t,od,'.','MarkerSize',15)
hold on
plot(tt,y);
ylabel('OD_6_0_0','FontSize',18)
xlabel('Time (min)','FontSize',18)
legend(leg,'Location','Best','FontSize',18)
title('Growth Rates, y=be^a^t, min^-^1','FontSize',18)

%figure
%barweb(avg_gr,2*std_gr)